#if !defined(AFX_IMGSTATIC_H__46201DD2_A609_4E63_AB7F_61C960A7F14F__INCLUDED_)
#define AFX_IMGSTATIC_H__46201DD2_A609_4E63_AB7F_61C960A7F14F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "SysDef.h"
// ImgStatic.h : header file
//
//

/////////////////////////////////////////////////////////////////////////////
// CImgStatic window

class CImgStatic : public CStatic
{
// Construction
public:
	CImgStatic();

// Attributes
public:
	int m_nImgWidth;
	int m_nImgHeight;

	tagBMP_INFO m_Bmp_Info;

// Operations
public:
	/// loads a img file
	void  SetImgSize(int nWidth, int nHeight);

	void  LoadImgFile(LPCTSTR pszImg_File);
	BOOL  LoadImgTxtInfo(LPCTSTR pszBmpFileName, LPCTSTR pszTxt, int nLedWidth, int nLedHeight, LPCTSTR pszFontName, int nColor, BOOL bBold);

	BOOL SaveBufToFileName(BYTE *pBuf, LPCTSTR pszFileName, int nWidth, int nHeight);

	BOOL  CreateDoubleBuffer(tagBMP_INFO& bmp_Info);
	BYTE* CreateDoubleBuffer(CRect rc, BITMAPFILEHEADER& bmfh, BITMAPINFO& bmi, CDC& dc, HBITMAP& hBmp, CBitmap& bmp);

	void  DestroyDoubleBuffer(tagBMP_INFO& bmp_Info);
	void  DestroyDoubleBuffer(CDC& dc, HBITMAP& hBmp, CBitmap& bmp);
	void  SaveMemBmp(LPCTSTR pszImgFileName, BITMAPFILEHEADER& bmfh, BITMAPINFO& bmi, BYTE *pBits);

	void  DrawMemBmp(int nDestPosX, int nDestPosY, int nDestWidth, int nDestHeight, CDC* pSrcDC, int nSrcPosX, int nSrcPosY, int nSrcWidth, int nSrcHeight);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CImgStatic)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CImgStatic();

	// Generated message map functions
protected:
	//{{AFX_MSG(CImgStatic)
	afx_msg void OnPaint();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_IMGSTATIC_H__46201DD2_A609_4E63_AB7F_61C960A7F14F__INCLUDED_)
